import { ITodoData } from "./typing";

class TodoTemplate {
    protected todoView(todo: ITodoData) {
        const { id, content, completed } = todo
        return `
            <input type="checkbox" placeholder="请输入待办事项" data-id="${id}" ${completed ? 'checked' : ''}>
            <span data-id="${id}" style="${completed ? "line-through" : "none"}" >${content}</span>
            <button data-id="${id}">删除</button>
        `
    }
}
export default TodoTemplate